﻿namespace Sgr.Oss
{
    /// <summary>
    /// S3兼容存储服务配置选项
    /// </summary>
    public class S3Options
    {
        /// <summary>
        /// 服务终端节点地址，例如：https://minio.example.com:9000
        /// </summary>
        public string EndPoint { get; set; } = string.Empty;

        /// <summary>
        /// 访问密钥ID
        /// </summary>
        public string AccessKey { get; set; } = string.Empty;

        /// <summary>
        /// 私有访问密钥
        /// </summary>
        public string SecretKey { get; set; } = string.Empty;

        /// <summary>
        /// 是否使用HTTPS连接
        /// </summary>
        public bool UseHttps { get; set; } = true;

        /// <summary>
        /// 会话令牌（主要用于临时凭证）
        /// </summary>
        public string? SessionToken { get; set; }

        /// <summary>
        /// 默认存储区域，例如：us-east-1
        /// </summary>
        public string Region { get; set; } = "us-east-1";

        /// <summary>
        /// 对象存储公共访问URL基础地址
        /// </summary>
        public string PublicBaseUrl { get; set; } = string.Empty;

        /// <summary>
        /// 预签名URL默认过期时间（分钟）
        /// </summary>
        public int DefaultPresignedUrlExpiryMinutes { get; set; } = 60;

        /// <summary>
        /// 是否在启动时验证连接
        /// </summary>
        public bool ValidateOnStartup { get; set; } = true;

        /// <summary>
        /// 重试次数
        /// </summary>
        public int MaxRetryCount { get; set; } = 3;

        /// <summary>
        /// 请求超时时间（秒）
        /// </summary>
        public int TimeoutSeconds { get; set; } = 30;

        /// <summary>
        /// 存储桶缓存过期时间（秒）
        /// </summary>
        public int BucketCacheSeconds { get; set; } = 300; // 默认5分钟
    }
}